@extends('public.base')
@section('body')
    <link rel="stylesheet" href="{{ADMIN_PATH}}css/demo.css" type="text/css" />
    <script src="{{ADMIN_PATH}}jquery/dist/jquery.js"></script>
    <script src="{{ADMIN_PATH}}layui/layuiadmin/layui/layui.js"></script>
    <script src="{{ADMIN_PATH}}js/admin.common.js"></script>
    <script type="text/javascript" src="{{ADMIN_PATH}}/js/awardRotate.js"></script>
<div class="layui-row">
    <div class="layui-card">
        <div class="layui-card-body">
            <form id="main_form" class="layui-form layui-form-pane" action="" method="post" lay-filter="main-form-group">
            <div class="layui-tab-content">
    <div class="g-wrap">
        <div class="turntable-bg">
            <!--<div class="mask"><img src="__MSTATIC__/images/award_01.png"/></div>-->
            <div class="pointer"><img src="{{ADMIN_PATH}}/images/pointer.png" alt="pointer"/></div>
            <div class="rotate" ><img id="rotate" src="{{ADMIN_PATH}}/images/turntable2.png" alt="turntable"/></div>
        </div>
        <?php
            $now_time=time();
       ?>

         <?php if($now_time<$info["start_time"]){ ?>

        <div class="g-cjcs font18">活动还未开始</div>
        <div class="g-cjcs2">
            <p>开始时间：{$info.start_date|date='Y-m-d H:i',###}</p>
            <p>结束时间：{$info.end_date|date='Y-m-d H:i',###}</p>
        </div>
<?php   }else if($now_time>$info["end_date"]){  ?>
        <div class="g-cjcs font18">
            活动已结束您来晚了<br>
            <!--                <span>{$info.start_date|date='Y-m-d H:i',###}-{$info.end_date|date='Y-m-d H:i',###}</span>-->
        </div>
<?php  }else{  ?>
        <div class="g-cjcs font18">您还有<span class="g-cjcolor" id="last_num">{$last_num}</span>次抽奖机会</div>
<?php } ?>

        <div class="g_bt" style="top: 3.2rem;">
            <button class="g_btn font18 show_award"  type="button" >中奖情况</button>
        </div>

    </div>
    <div class="weui_dialog_alert" id="dialog3" style="display:none"></div>

    <script>
        $(".show_award").bind("click", function () {

            $.ajax({
                type: 'POST',
                url: '{:U("show_award")}',
                data: {},
                async: false,
                dataType: 'json',
                success: function (data) {
                    ui.loading_delete();
                    if (data.code) {

                        var html=data.url.html;

                        $('#dialog3').html(html);
                        $('#dialog3').show().on('click', '.weui_btn_dialog', function () {
                            $('#dialog3').off('click').hide();
                        });
                        return false;
                    } else {
                        ui.error(data.msg);
                    }
                },
                error: function () {
                    ui.error("异常");
                }
            });

        });
    </script>

</div>
            </form>   </div></div></div>

@stop
